﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UwinEducation.Application.Dtos;
using UwinEducation.Domain.Entities;


namespace UwinEducation.Application.Mappings
{

    public class UserProfile : Profile
    {
        public UserProfile()
        {
            CreateMap<User, UserDto>()
                .ForMember(dest => dest.IsEnabled, opt => opt.MapFrom(src => src.IsActive));

            //CreateMap<RolePermission, RolePermission>();

            CreateMap<CreateUserDto, User>()
                 .ForMember(dest => dest.IsActive, opt => opt.MapFrom(src => src.IsEnabled));
            CreateMap<UpdateUserDto, User>()
                 .ForMember(dest => dest.IsActive, opt => opt.MapFrom(src => src.IsEnabled));


            //CreateMap<Role, RoleDto>()
            //.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name));
        }
    }
}
